// type Result = ['p0', 'p1', 'p2', 'p3']
// type ResultField = Result[number]
// type GenerateObject = {
//   [key in ResultField]: string
// }


// type ResultField<Result extends string[] = ['p0', 'p1', 'p2', 'p3']>
//   = Result[number]
// type GenerateObject = {
//   [key in ResultField]: string
// }

type ResultField<Count extends number, Result extends string[] = []>
  = Result['length'] extends Count ?
  Result[number] : ResultField<Count, [...Result, `p${Result['length']}`]>

type GenerateObject<Count extends number> = {
  [key in ResultField<Count>]: string
}

type MyObj = Omit<GenerateObject<2>, 'p0'> & {
  id: number
}

const me: MyObj = {
  p1: '123',
  id: 123
}
console.log(typeof me)
